<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:s="http://jboss.com/products/seam/taglib"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:rich="http://richfaces.org/rich"
    template="layout/template.xhtml">

<ui:define name="body">

    <rich:panel>
        <f:facet name="header">Bayi Details</f:facet>

        <s:decorate id="id" template="layout/display.xhtml">
            <ui:define name="label">Id</ui:define>
            <h:outputText value="#{bayiHome.instance.id}">
                <f:convertNumber/>
            </h:outputText>
        </s:decorate>

        <s:decorate id="unvan" template="layout/display.xhtml">
            <ui:define name="label">Unvan</ui:define>
            <h:outputText value="#{bayiHome.instance.unvan}"/>
        </s:decorate>

        <s:decorate id="bayiKodu" template="layout/display.xhtml">
            <ui:define name="label">Bayi kodu</ui:define>
            <h:outputText value="#{bayiHome.instance.bayiKodu}"/>
        </s:decorate>

        <s:decorate id="musteridekiKodu" template="layout/display.xhtml">
            <ui:define name="label">Musterideki kodu</ui:define>
            <h:outputText value="#{bayiHome.instance.musteridekiKodu}"/>
        </s:decorate>

        <s:decorate id="binaAdi" template="layout/display.xhtml">
            <ui:define name="label">Bina adi</ui:define>
            <h:outputText value="#{bayiHome.instance.binaAdi}"/>
        </s:decorate>

        <s:decorate id="binaNo" template="layout/display.xhtml">
            <ui:define name="label">Bina no</ui:define>
            <h:outputText value="#{bayiHome.instance.binaNo}"/>
        </s:decorate>

        <s:decorate id="cadde" template="layout/display.xhtml">
            <ui:define name="label">Cadde</ui:define>
            <h:outputText value="#{bayiHome.instance.cadde}"/>
        </s:decorate>

        <s:decorate id="daireNo" template="layout/display.xhtml">
            <ui:define name="label">Daire no</ui:define>
            <h:outputText value="#{bayiHome.instance.daireNo}"/>
        </s:decorate>

        <s:decorate id="iptal" template="layout/display.xhtml">
            <ui:define name="label">Iptal</ui:define>
            <h:outputText value="#{bayiHome.instance.iptal}"/>
        </s:decorate>

        <s:decorate id="katNo" template="layout/display.xhtml">
            <ui:define name="label">Kat no</ui:define>
            <h:outputText value="#{bayiHome.instance.katNo}"/>
        </s:decorate>

        <s:decorate id="postaKodu" template="layout/display.xhtml">
            <ui:define name="label">Posta kodu</ui:define>
            <h:outputText value="#{bayiHome.instance.postaKodu}"/>
        </s:decorate>

        <s:decorate id="sokak" template="layout/display.xhtml">
            <ui:define name="label">Sokak</ui:define>
            <h:outputText value="#{bayiHome.instance.sokak}"/>
        </s:decorate>

        <s:decorate id="ticariUnvan" template="layout/display.xhtml">
            <ui:define name="label">Ticari unvan</ui:define>
            <h:outputText value="#{bayiHome.instance.ticariUnvan}"/>
        </s:decorate>

        <s:decorate id="ilceEskiAdi" template="layout/display.xhtml">
            <ui:define name="label">Ilce eski adi</ui:define>
            <h:outputText value="#{bayiHome.instance.ilceEskiAdi}"/>
        </s:decorate>

        <s:decorate id="semtAdiEski" template="layout/display.xhtml">
            <ui:define name="label">Semt adi eski</ui:define>
            <h:outputText value="#{bayiHome.instance.semtAdiEski}"/>
        </s:decorate>

        <s:decorate id="adresEski" template="layout/display.xhtml">
            <ui:define name="label">Adres eski</ui:define>
            <h:outputText value="#{bayiHome.instance.adresEski}"/>
        </s:decorate>

        <s:decorate id="bayiTipiEski" template="layout/display.xhtml">
            <ui:define name="label">Bayi tipi eski</ui:define>
            <h:outputText value="#{bayiHome.instance.bayiTipiEski}"/>
        </s:decorate>

        <s:decorate id="kullaniciKoduEski" template="layout/display.xhtml">
            <ui:define name="label">Kullanici kodu eski</ui:define>
            <h:outputText value="#{bayiHome.instance.kullaniciKoduEski}"/>
        </s:decorate>

        <div style="clear:both"/>

    </rich:panel>

    <div class="actionButtons">

        <s:button view="/BayiEdit.xhtml"
                    id="edit"
                 value="Edit"/>

        <s:button view="/#{empty bayiFrom ? 'BayiList' : bayiFrom}.xhtml"
                    id="done"
                 value="Done"/>

    </div>

    <rich:tabPanel switchType="ajax">

    <rich:tab>
        <f:facet name="label">
            <h:panelGroup><h:graphicImage value="/img/manytoone.gif" style="vertical-align: middle; padding-right: 4px;"/>Ilce</h:panelGroup>
        </f:facet>
    <div class="association" id="ilceParent">

        <h:outputText value="There is no ilce associated with this bayi."
                   rendered="#{bayiHome.instance.ilce == null}"/>

        <rich:dataTable var="_ilce"
                   value="#{bayiHome.instance.ilce}"
                rendered="#{bayiHome.instance.ilce != null}"
              rowClasses="rvgRowOne,rvgRowTwo"
                      id="ilceTable">
            <h:column>
                <f:facet name="header">Id</f:facet>
                <h:outputText value="#{_ilce.id}">
                    <f:convertNumber/>
                </h:outputText>
            </h:column>
            <h:column>
                <f:facet name="header">Iller id</f:facet>
                <h:outputText value="#{_ilce.iller.id}">
                    <f:convertNumber/>
                </h:outputText>
            </h:column>
            <h:column>
                <f:facet name="header">Ilce adi</f:facet>
                <h:outputText value="#{_ilce.ilceAdi}"/>
            </h:column>
            <h:column styleClass="action">
                <f:facet name="header">Action</f:facet>
                <s:link id="viewilce"
                     value="View"
                      view="/Ilce.xhtml">
                    <f:param name="ilceId"
                           value="#{_ilce.id}"/>
                </s:link>
            </h:column>
        </rich:dataTable>

    </div>
    </rich:tab>

    <rich:tab>
        <f:facet name="label">
            <h:panelGroup><h:graphicImage value="/img/manytoone.gif" style="vertical-align: middle; padding-right: 4px;"/>Semtler</h:panelGroup>
        </f:facet>
    <div class="association" id="semtlerParent">

        <h:outputText value="There is no semtler associated with this bayi."
                   rendered="#{bayiHome.instance.semtler == null}"/>

        <rich:dataTable var="_semtler"
                   value="#{bayiHome.instance.semtler}"
                rendered="#{bayiHome.instance.semtler != null}"
              rowClasses="rvgRowOne,rvgRowTwo"
                      id="semtlerTable">
            <h:column>
                <f:facet name="header">Id</f:facet>
                <h:outputText value="#{_semtler.id}">
                    <f:convertNumber/>
                </h:outputText>
            </h:column>
            <h:column>
                <f:facet name="header">Ilce id</f:facet>
                <h:outputText value="#{_semtler.ilce.id}">
                    <f:convertNumber/>
                </h:outputText>
            </h:column>
            <h:column>
                <f:facet name="header">Semt adi</f:facet>
                <h:outputText value="#{_semtler.semtAdi}"/>
            </h:column>
            <h:column styleClass="action">
                <f:facet name="header">Action</f:facet>
                <s:link id="viewsemtler"
                     value="View"
                      view="/Semtler.xhtml">
                    <f:param name="semtlerId"
                           value="#{_semtler.id}"/>
                </s:link>
            </h:column>
        </rich:dataTable>

    </div>
    </rich:tab>

    <rich:tab>
        <f:facet name="label">
            <h:panelGroup><h:graphicImage value="/img/manytoone.gif" style="vertical-align: middle; padding-right: 4px;"/>Iller</h:panelGroup>
        </f:facet>
    <div class="association" id="illerParent">

        <h:outputText value="There is no iller associated with this bayi."
                   rendered="#{bayiHome.instance.iller == null}"/>

        <rich:dataTable var="_iller"
                   value="#{bayiHome.instance.iller}"
                rendered="#{bayiHome.instance.iller != null}"
              rowClasses="rvgRowOne,rvgRowTwo"
                      id="illerTable">
            <h:column>
                <f:facet name="header">Id</f:facet>
                <h:outputText value="#{_iller.id}">
                    <f:convertNumber/>
                </h:outputText>
            </h:column>
            <h:column>
                <f:facet name="header">Bolge id</f:facet>
                <h:outputText value="#{_iller.bolge.id}">
                    <f:convertNumber/>
                </h:outputText>
            </h:column>
            <h:column>
                <f:facet name="header">Ulke id</f:facet>
                <h:outputText value="#{_iller.ulke.id}">
                    <f:convertNumber/>
                </h:outputText>
            </h:column>
            <h:column>
                <f:facet name="header">Il adi</f:facet>
                <h:outputText value="#{_iller.ilAdi}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Plaka kodu</f:facet>
                <h:outputText value="#{_iller.plakaKodu}"/>
            </h:column>
            <h:column styleClass="action">
                <f:facet name="header">Action</f:facet>
                <s:link id="viewiller"
                     value="View"
                      view="/Iller.xhtml">
                    <f:param name="illerId"
                           value="#{_iller.id}"/>
                </s:link>
            </h:column>
        </rich:dataTable>

    </div>
    </rich:tab>

    <rich:tab>
        <f:facet name="label">
            <h:panelGroup><h:graphicImage value="/img/onetomany.gif" style="vertical-align: middle; padding-right: 4px;"/>Bayi gpses</h:panelGroup>
        </f:facet>
    <h:form styleClass="association" id="bayiGpsesChildren">

        <h:outputText value="There are no bayiGpses associated with this bayi."
                   rendered="#{empty bayiHome.bayiGpses}"/>

        <rich:dataTable value="#{bayiHome.bayiGpses}"
                       var="_bayiGps"
                  rendered="#{not empty bayiHome.bayiGpses}"
                rowClasses="rvgRowOne,rvgRowTwo"
                        id="bayiGpsesTable">
            <rich:column sortBy="#{_bayiGps.id}">
                <f:facet name="header">Id</f:facet>
                <h:outputText value="#{_bayiGps.id}">
                    <f:convertNumber/>
                </h:outputText>
            </rich:column>
            <rich:column sortBy="#{_bayiGps.latitude}">
                <f:facet name="header">Latitude</f:facet>
                <h:outputText value="#{_bayiGps.latitude}"/>
            </rich:column>
            <rich:column sortBy="#{_bayiGps.longitude}">
                <f:facet name="header">Longitude</f:facet>
                <h:outputText value="#{_bayiGps.longitude}"/>
            </rich:column>
            <rich:column sortBy="#{_bayiGps.type}">
                <f:facet name="header">Type</f:facet>
                <h:outputText value="#{_bayiGps.type}"/>
            </rich:column>
            <h:column>
                <f:facet name="header">Action</f:facet>
                <s:link id="selectbayiGps"
                     value="Select"
                      view="/BayiGps.xhtml">
                    <f:param name="bayiGpsId"
                            value="#{_bayiGps.id}"/>
                    <f:param name="bayiGpsFrom" value="Bayi"/>
                </s:link>
            </h:column>
        </rich:dataTable>

    </h:form>

    <div class="actionButtons">
        <s:button
               value="Add bayiGps"
                view="/BayiGpsEdit.xhtml">
            <f:param name="bayiId"
                    value="#{bayiHome.instance.id}"/>
            <f:param name="bayiGpsFrom" value="Bayi"/>
        </s:button>
    </div>
    </rich:tab>
</rich:tabPanel>
</ui:define>

</ui:composition>
